Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to deal with the problem of picture path in text editor

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

How to deal with the problem of picture path in the text editor, in view of this problem, this article introduces the corresponding analysis and answer in detail, hoping to help more partners who want to solve this problem to find a more simple and easy way.

Processing steps: 1. First find the configuration file framework of the plug-in using the imageUrlPrefix in the ueditor configuration file config.json

"imageUrlPrefix": "", / * Image access path prefix * /

two。 Although there are some disadvantages after changing to an online domain name (the domain name is dead, the replacement domain name needs to change the configuration), but the local domain name can run normally and submit it online has no effect.

3. It has been found for a long time that the reason why it is the modifier of tp is that the value of the content is replaced by the tp function in the model layer setPostContentAttr method when the data is inserted.

Public function getPostContentAttr ($value) {return cmf_replace_content_file_url (htmlspecialchars_decode ($value));}

Interpretation of functions in documents

Cmf_replace_content_file_url replace editor file address cmf_replace_content_file_url ($content, $isForDbSave = false) function replace the file address parameter $content: string editor content $isForDbSave: boolean true: change the absolute address to a relative address for database storage, false: change the relative address to an absolute address for the interface to display the editor content replaced by string

However, due to the inconsistency between the local domain name and the online domain name, and the online domain name was added to the configuration of the plug-in, the local function did not work, and the online domain name and configuration were removed directly.

4. So if you comment out the modifier directly here, you can save the absolute path of the image to the library, but because of the configuration problem mentioned above, there is no modification here in order to be flexible.

Adding a catcher to the model of the interface is exactly the opposite of the modifier above. When you take out the data, you modify the path directly to the absolute path of the online server.

This is the answer to the question about how to deal with the image path in the text editor. I hope the above content can be of some help to you, if you still have a lot of doubts to be solved. You can follow the industry information channel for more related knowledge.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report