如何仅在博客的联系人页面中显示小部件?

时间:2019-03-04 04:35:46

标签: blogger

我尝试了很多条件,但是没有用!

<b:if cond='data:blog.url == data:blog.homepageUrl + "p/contact-us.html"'>

<b:if cond='data:blog.url == data:blog.homepageUrl + &quot;p/contact-us.html&quot;'>

<b:if cond='data:blog.url == data:blog.canonicalHomepageUrl + "p/contact-us.html"'>

<b:if cond='data:blog.url == data:blog.canonicalHomepageUrl + &quot;p/contact-us.html&quot;'>

<b:if cond='data:blog.pageType == data:blog.homepageUrl + "p/contact-us.html"'>

<b:if cond='data:blog.pageType == data:blog.homepageUrl + &quot;p/contact-us.html&quot;'>

2 个答案:

答案 0 :(得分:1)

使用@EnableBinding({Source.class,Sink.class}) @RestController public class SourceExample { @Autowired private Source source; @GetMapping("/newMessage") public UserMessage sendMessage(@RequestParam("messageBody") String messageBody, @RequestParam("username") String username) { UserMessage userMessage = new UserMessage(messageBody, username, LocalDateTime.now()); this.source.output().send(new GenericMessage<>(userMessage)); return userMessage; } @StreamListener(target = Sink.INPUT) public void handle(UserMessage userMessage) throws IOException { System.out.println(userMessage); } } 测试是否正在访问特定页面

data:blog.pageId

编辑页面时,可以在地址栏中找到 Page_ID

enter image description here

答案 1 :(得分:0)

我只是使用有条件的页面名称!